﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ThridGroup.ERP.DTO.ProductionSystemDto.IncomingInspectionDto;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;

namespace ThridGroup.ERP.ProductionSystem
{
    /// <summary>
    /// 来料检验接口
    /// </summary>
    public interface IncomingInspectionServices
    {
        /// <summary>
        /// 添加来料检验
        /// </summary>
        /// <param name="createIncomingInspectionDto"></param>
        /// <returns></returns>
        Task<int> AddIncomingInspection(CreateIncomingInspectionDto createIncomingInspectionDto);

        /// <summary>
        /// 分页及多条件查询来料检验列表
        /// </summary>
        /// <param name="page">页码</param>
        /// <param name="limit">每页数量</param>
        /// <param name="incomingInspectionCode">来料检验单编号（模糊查询）</param>
        /// <param name="batch">供应商批次号（模糊查询）</param>
        /// <param name="testingResult">检测结果（等值查询）</param>
        /// <param name="testingPerson">检测人员（模糊查询）</param>
        /// <param name="productName">产品物料名称（模糊查询）</param>
        /// <param name="incomingDate">来料日期（等值查询）</param>
        /// <param name="testingDate">检测日期（等值查询）</param>
        /// <returns>分页后的来料检验列表</returns>
        Task<PagedResultDto<IncomingInspectionListDto>> GetIncomingInspectionList(int page, int limit, string incomingInspectionCode = null, string batch = null, string testingResult = null, string testingPerson = null, string productName = null, DateTime? incomingDate=null, DateTime? testingDate = null);

        /// <summary>
        /// 批量删除来料检验
        /// </summary>
        /// <param name="ids">要删除的ID集合</param>
        /// <returns></returns>
        Task BatchDeleteAsync(List<int> ids);


        /// <summary>
        /// 根据ID获取来料检验详情（反填）
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns></returns>
        Task<IncomingInspectionListDto> GetByIdAsync(int id);

        /// <summary>
        /// 删除单条来料检验
        /// </summary>
        /// <param name="id">主键ID</param>
        /// <returns></returns>
        Task DeleteAsync(int id);

        /// <summary>
        /// 修改单条来料检验
        /// </summary>
        /// <param name="dto">要修改的来料检验DTO</param>
        /// <returns></returns>
        Task UpdateAsync(CreateIncomingInspectionDto dto);

        /// <summary>
        /// 导出来料检验数据
        /// </summary>
        /// <param name="query">导出条件</param>
        /// <returns>导出文件的二进制流</returns>
        Task<byte[]> ExportAsync(string incomingInspectionCode = null, string batch = null, string testingResult = null, string testingPerson = null, string productName = null, DateTime? incomingDate=null, DateTime? testingDate = null);
    }
}
